<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <title>ISeeAdmin 【DatePicker 日期选择器】 </title>
    <!--    <link rel="stylesheet" href="/static/element/index.css">-->
    <link href="https://cdn.staticfile.org/element-ui/2.12.0/theme-chalk/index.css" rel="stylesheet">
    <link rel="stylesheet" href="/static/iconfont/iconfont.css">
    <link rel="stylesheet" href="/static/css/common.css">
    <!--    开发环境-->
    <!--        <script src="/static/js/iseeadmin.js"></script>-->
    <!--    正式环境-->
    <script src="/static/js/iseeadmin.min.js"></script>
    <script src="/static/js/menu.js"></script>
    <!--    开发环境-->
    <!--    <script src="/static/js/vue.js"></script>-->
    <!--    正式环境-->
    <!--        <script src="/static/js/vue.min.js"></script>-->
    <script src="https://cdn.staticfile.org/vue/2.6.10/vue.min.js"></script>
    <!--    <script src="/static/element/index.js"></script>-->
    <script src="https://cdn.staticfile.org/element-ui/2.12.0/index.js"></script>
    <!--    <script src="/static/js/axios.min.js"></script>-->
</head>
<body>
<div id="app" v-cloak>
    <el-container style="height: 100%;min-height:100vh;">
        <el-aside v-show="iseeData.asideShow" width="210px">
            <!--            左侧logo 开始-->
            <div class="aside-logo">
                <img class="aside-logo-img" src="/static/images/logo.png"
                     alt=""> ISeeAdmin
            </div>
            <!--            左侧logo 结束-->
            <!--            左侧菜单 开始-->
            <el-menu @select="iseeMenuOpen" style="width: 210px;"
                     unique-opened
                     :default-active="iseeData.defaultActive"
                     background-color="#304156"
                     text-color="#bfcbd9"
                     active-text-color="#409eff">
                <iseemenu :menu="iseeData.menu"></iseemenu>
            </el-menu>
            <!--            左侧菜单 结束-->
        </el-aside>

        <el-container>
            <el-header height="83px">
                <div class="isee-header-div">
                    <!--                    面包屑 开始-->
                    <div style="width: 100%;display: inherit;">
                        <span class="aside-show" @click="iseeAsideShow">
                            <i :class="iseeData.asideShowIcon"></i>
                        </span>

                        <el-breadcrumb style="line-height: 50px" separator="/">
                            <el-breadcrumb-item v-for="(item,index) in iseeData.breadcrumb" :key="index">{{item.title}}
                            </el-breadcrumb-item>
                        </el-breadcrumb>
                    </div>
                    <!--                    面包屑 结束-->
                    <!--                    icon功能列表，可根据需要修改 开始-->
                    <div>
                        <ul class="isee-ul">
                            <li class="isee-li">
                                <i style="font-size: 20px" class="el-icon-bell"></i>
                            </li>
                            <li @click="iseeFullScreen" class="isee-li">
                                <span class="iconfont" style="font-size: 20px" v-html="iseeData.fullscreenIcon"></span>
                            </li>
                            <li class="isee-li" @click="iseeData.drawer = true">
                                <span class="iconfont" style="font-size: 20px">&#xe602;</span>
                            </li>
                        </ul>
                    </div>
                    <!--                    icon功能列表，可根据需要修改 结束-->
                    <!--                    avatar显示 开始-->
                    <div>
                        <el-dropdown @command="iseeOpenUrl">
                              <span class="el-dropdown-link">
                                  <el-avatar style="margin-top: 9px" :size="iseeData.avatar.size"
                                             :src="iseeData.avatar.url"></el-avatar>
                              </span>

                            <el-dropdown-menu slot="dropdown">
                                <el-dropdown-item v-for="(item,index) in iseeData.avatar.list" :icon="item.icon"
                                                  :key="index" :command="index">{{item.title}}
                                </el-dropdown-item>
                            </el-dropdown-menu>
                        </el-dropdown>
                    </div>
                    <!--                    avatar显示 结束-->
                </div>
                <div style="display: flex">
                    <!--                    标签页列表 开始-->
                    <span @click="iseeTagDivMove(1)" class="isee-tag-span">
                        <i class="el-icon-d-arrow-left"></i>
                    </span>
                    <div ref="iseeTagDiv" class="isee-tag-div">
                        <el-tag style="cursor:pointer;margin-right: 5px;" v-for="(item,index) in iseeData.tagList"
                                :key="index"
                                @click="iseeTagSwitch(item.url,item.index,item.breadcrumb)"
                                :effect="item.effect"
                                :type="item.type"
                                @close="iseeTagClose(item.url,index)"
                                size="medium"
                                :closable="item.closable"><i v-show="item.show" class="el-icon-view"></i> {{item.title}}
                        </el-tag>
                    </div>
                    <span @click="iseeTagDivMove(2)" class="isee-tag-span">
                        <i class="el-icon-d-arrow-right"></i>
                    </span>
                    <!--                    标签页列表 结束-->
                    <!--                    标签页集中操作 开始-->
                    <div style="float: right;margin-left: 10px">
                        <el-dropdown @command="iseeTagCommandClose">
                          <span class="el-dropdown-link">
                              <i class="el-icon-arrow-down isee-el-icon-arrow-down"></i>
                          </span>
                            <el-dropdown-menu slot="dropdown">
                                <el-dropdown-item command="1">关闭当前标签页</el-dropdown-item>
                                <el-dropdown-item command="2">关闭其它标签页</el-dropdown-item>
                                <el-dropdown-item command="3">关闭全部标签页</el-dropdown-item>
                            </el-dropdown-menu>
                        </el-dropdown>
                    </div>
                    <!--                    标签页集中操作 结束-->
                </div>

                <!--抽屉式展示-->
                <el-drawer
                        title="iseeAdmin"
                        :visible.sync="iseeData.drawer"
                        :direction="iseeData.direction"
                        :show-close="iseeData.showClose"
                        custom-class="isee-drawer-info"
                >
                    <el-divider></el-divider>
                    <div style="font-size: 14px">
                        <p class="isee-title">版本信息</p>
                        <ul class="isee-drawer-ul">
                            <li>
                                当前版本：iseeAdmin-v{{iseeData.version}}
                            </li>
                            <li>
                                基于框架：vue v2.6.10，element v2.12.0
                            </li>
                            <li>
                                下载地址：
                                <el-link type="primary" :underline="false" href="https://gitee.com/youge/iseeadmin"
                                         target="_blank">码云
                                </el-link>
                                |
                                <el-link type="primary" :underline="false" href="https://github.com/fukedi/iseeadmin"
                                         target="_blank">github
                                </el-link>
                            </li>
                        </ul>
                    </div>
                    <el-divider></el-divider>
                    <div style="font-size: 14px">
                        <p class="isee-title">关于版权</p>
                        <ul class="isee-drawer-ul">
                            <li>
                                iseeAdmin完全开源，可免费使用
                            </li>
                            <li>
                                QQ交流群：927049524
                            </li>
                        </ul>
                    </div>
                </el-drawer>
                <!--抽屉式展示 结束-->
            </el-header>

            <el-main>
                <!--                主内容展示-->
                <div style="margin-right: 10px">
                    <el-card class="box-card">
                        DatePicker 日期选择器
                        <el-link type="primary" target="_blank"
                                 href="https://element.eleme.cn/#/zh-CN/component/date-picker">
                            官方文档 https://element.eleme.cn/#/zh-CN/component/date-picker
                        </el-link>
                    </el-card>
                </div>
                <div style="display: flex">
                    <el-card class="box-card">
                        <el-divider content-position="left"><span
                                class="el-divider-span">选择日 <el-tooltip
                                content="基本单位由type属性指定。快捷选项需配置picker-options对象中的shortcuts，禁用日期通过 disabledDate 设置，传入函数 " placement="top" effect="light"><i
                                class="el-icon-info" style="color: gray"></i></el-tooltip></span></el-divider>
                        <template>
                            <el-row>
                                <el-col :span="4">
                                        <span style="line-height: 40px;font-size: 14px">
                                            默认
                                        </span>
                                </el-col>
                                <el-col :span="19" :gutter="1">
                                    <el-date-picker
                                            v-model="value1"
                                            type="date"
                                            placeholder="选择日期">
                                    </el-date-picker>
                                </el-col>
                            </el-row>
                            <div style="padding:10px "></div>
                            <el-row>
                                <el-col :span="4">
                                        <span style="line-height: 40px;font-size: 14px">
                                            带快捷选项
                                        </span>
                                </el-col>
                                <el-col :span="19" :gutter="1">
                                    <el-date-picker
                                            v-model="value2"
                                            align="right"
                                            type="date"
                                            placeholder="选择日期"
                                            :picker-options="pickerOptions">
                                    </el-date-picker>
                                </el-col>
                            </el-row>
                        </template>

                        <el-divider content-position="left"><span
                                class="el-divider-span">其他日期单位 <el-tooltip
                                content="通过扩展基础的日期选择，可以选择周、月、年或多个日期 " placement="top" effect="light"><i
                                class="el-icon-info" style="color: gray"></i></el-tooltip></span></el-divider>

                        <el-row>
                            <el-col :span="4">
                                        <span style="line-height: 40px;font-size: 14px">
                                            周
                                        </span>
                            </el-col>
                            <el-col :span="19" :gutter="1">
                                <el-date-picker
                                        v-model="value3"
                                        type="week"
                                        format="yyyy 第 WW 周"
                                        placeholder="选择周">
                                </el-date-picker>
                            </el-col>
                        </el-row>
                        <div style="padding:10px "></div>
                        <el-row>
                            <el-col :span="4">
                                        <span style="line-height: 40px;font-size: 14px">
                                            月
                                        </span>
                            </el-col>
                            <el-col :span="19" :gutter="1">
                                <el-date-picker
                                        v-model="value4"
                                        type="month"
                                        placeholder="选择月">
                                </el-date-picker>
                            </el-col>
                        </el-row>
                        <div style="padding:10px "></div>
                        <el-row>
                            <el-col :span="4">
                                        <span style="line-height: 40px;font-size: 14px">
                                            年
                                        </span>
                            </el-col>
                            <el-col :span="19" :gutter="1">
                                <el-date-picker
                                        v-model="value5"
                                        type="year"
                                        placeholder="选择年">
                                </el-date-picker>
                            </el-col>
                        </el-row>
                        <div style="padding:10px "></div>
                        <el-row>
                            <el-col :span="4">
                                        <span style="line-height: 40px;font-size: 14px">
                                            多个日期
                                        </span>
                            </el-col>
                            <el-col :span="19" :gutter="1">
                                <el-date-picker
                                        type="dates"
                                        v-model="value6"
                                        placeholder="选择一个或多个日期">
                                </el-date-picker>
                            </el-col>
                        </el-row>

                        <el-divider content-position="left"><span
                                class="el-divider-span">选择日期范围 <el-tooltip
                                content="在选择日期范围时，默认情况下左右面板会联动。如果希望两个面板各自独立切换当前月份，可以使用unlink-panels属性解除联动 "
                                placement="top" effect="light"><i
                                class="el-icon-info" style="color: gray"></i></el-tooltip></span></el-divider>
                        <template>
                            <el-row>
                                <el-col :span="12" style="text-align: center">
                                        <span style="line-height: 40px;font-size: 14px;text-align: center">
                                            默认
                                        </span>
                                </el-col>
                                <el-col :span="12" style="text-align: center">
                                    <span style="line-height: 40px;font-size: 14px;">
                                            带快捷选项
                                        </span>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12" style="text-align: center">
                                    <el-date-picker
                                            v-model="value1"
                                            type="daterange"
                                            range-separator="至"
                                            start-placeholder="开始日期"
                                            end-placeholder="结束日期">
                                    </el-date-picker>
                                </el-col>
                                <el-col :span="12" style="text-align: center">
                                    <el-date-picker
                                            v-model="value12"
                                            type="daterange"
                                            align="right"
                                            unlink-panels
                                            range-separator="至"
                                            start-placeholder="开始日期"
                                            end-placeholder="结束日期"
                                            :picker-options="pickerOptions1">
                                    </el-date-picker>
                                </el-col>
                            </el-row>
                        </template>

                    </el-card>

                    <el-card class="box-card">

                        <el-divider content-position="left"><span
                                class="el-divider-span">选择月份范围 <el-tooltip
                                content="在选择月份范围时，默认情况下左右面板会联动。如果希望两个面板各自独立切换当前年份，可以使用unlink-panels属性解除联动。 "
                                placement="top" effect="light"><i
                                class="el-icon-info" style="color: gray"></i></el-tooltip></span></el-divider>
                        <template>
                            <el-row>
                                <el-col :span="12" style="text-align: center">
                                        <span style="line-height: 40px;font-size: 14px;">
                                            默认
                                        </span>
                                </el-col>
                                <el-col :span="12" style="text-align: center">
                                    <span style="line-height: 40px;font-size: 14px;">
                                            带快捷选项
                                        </span>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12" style="text-align: center">
                                    <el-date-picker
                                            v-model="value7"
                                            type="monthrange"
                                            range-separator="至"
                                            start-placeholder="开始月份"
                                            end-placeholder="结束月份">
                                    </el-date-picker>
                                </el-col>
                                <el-col :span="12" style="text-align: center">
                                    <el-date-picker
                                            v-model="value8"
                                            type="monthrange"
                                            align="right"
                                            unlink-panels
                                            range-separator="至"
                                            start-placeholder="开始月份"
                                            end-placeholder="结束月份"
                                            :picker-options="pickerOptions2">
                                    </el-date-picker>
                                </el-col>
                            </el-row>
                        </template>


                        <el-divider content-position="left"><span
                                class="el-divider-span">日期格式 <el-tooltip
                                content="使用format指定输入框的格式；使用value-format指定绑定值的格式。默认情况下，组件接受并返回Date对象。以下为可用的格式化字串。详细用法请看官方文档 "
                                placement="top" effect="light"><i
                                class="el-icon-info" style="color: gray"></i></el-tooltip></span></el-divider>
                        <template>
                            <el-row>
                                <el-col :span="8" style="text-align: center">
                                        <span style="line-height: 40px;font-size: 14px;">
                                            默认为 Date 对象
                                        </span>
                                </el-col>
                                <el-col :span="8" style="text-align: center">
                                    <span style="line-height: 40px;font-size: 14px;">
                                            使用 value-format
                                        </span>
                                </el-col>
                                <el-col :span="8" style="text-align: center">
                                    <span style="line-height: 40px;font-size: 14px;">
                                            时间戳
                                        </span>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="8" style="text-align: center">
                                        <span style="line-height: 40px;font-size: 14px;">
                                            值：{{value9}}
                                        </span>
                                </el-col>
                                <el-col :span="8" style="text-align: center">
                                    <span style="line-height: 40px;font-size: 14px;">
                                            值：{{value10}}
                                        </span>
                                </el-col>
                                <el-col :span="8" style="text-align: center">
                                    <span style="line-height: 40px;font-size: 14px;">
                                            值：{{value11}}
                                        </span>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="8" style="text-align: center">
                                    <el-date-picker
                                            v-model="value9"
                                            type="date"
                                            placeholder="选择日期"
                                            format="yyyy 年 MM 月 dd 日">
                                    </el-date-picker>
                                </el-col>
                                <el-col :span="8" style="text-align: center">
                                    <el-date-picker
                                            v-model="value10"
                                            type="date"
                                            placeholder="选择日期"
                                            format="yyyy 年 MM 月 dd 日"
                                            value-format="yyyy-MM-dd">
                                    </el-date-picker>
                                </el-col>
                                <el-col :span="8" style="text-align: center">
                                    <el-date-picker
                                            v-model="value11"
                                            type="date"
                                            placeholder="选择日期"
                                            format="yyyy 年 MM 月 dd 日"
                                            value-format="timestamp">
                                    </el-date-picker>
                                </el-col>
                            </el-row>
                        </template>

                        <el-divider content-position="left"><span
                                class="el-divider-span">默认显示日期 <el-tooltip
                                content="选择日期范围时，默认情况下，起始日期和结束日期的时间部分均为当天的 0 点 0 分 0 秒。通过default-time可以分别指定二者的具体时刻。default-time接受一个数组，其中的值为形如12:00:00的字符串，第一个值控制起始日期的时刻，第二个值控制结束日期的时刻。 " placement="top"
                                effect="light"><i
                                class="el-icon-info" style="color: gray"></i></el-tooltip></span></el-divider>
                        <template>
                            <el-row>
                                <el-col :span="24">
                                        <span style="line-height: 40px;font-size: 14px;">
                                            组件值：{{ value }}
                                        </span>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-date-picker
                                            v-model="value"
                                            type="daterange"
                                            start-placeholder="开始日期"
                                            end-placeholder="结束日期"
                                            :default-time="['00:00:00', '23:59:59']">
                                    </el-date-picker>
                                </el-col>
                            </el-row>
                        </template>


                    </el-card>
                </div>
                <!--                主内容展示 结束-->
            </el-main>
        </el-container>
    </el-container>
</div>


<script>
  const iseeAvatar = {
    url: '/static/images/avatar01.gif',
    size: 32,
    list: [
      {
        index: '',
        indexPath: [],
        icon: 'el-icon-user-solid',
        url: '',
        target: '_self',
        title: 'admin',
      }, {
        index: '6-1-0',
        indexPath: ["6", "6-1", "6-1-0"],
        icon: 'el-icon-tickets',
        url: '/pages/sets/myset/profile.html',
        target: '_self',
        title: '基本资料',
      }, {
        index: '6-1-1',
        indexPath: ["6", "6-1", "6-1-1"],
        icon: 'el-icon-edit-outline',
        url: '/pages/sets/myset/password.html',
        target: '_self',
        title: '修改密码',
      }, {
        index: '',
        indexPath: [],
        icon: 'el-icon-switch-button',
        url: '',
        target: '_self',
        title: '安全退出',
      },
    ]
  }
  var iseemenu = {
    props: ['menu'],
    name: 'iseemenu',
    template: `
    <div>
        <template v-for="item in menu">
            <el-submenu :index="item.index" v-if="item.children.length">
                <template slot="title">
                    <i :class="item.icon"></i>
                    <span slot="title">{{item.title}}</span>
                </template>
                <iseemenu :menu="item.children"></iseemenu>
            </el-submenu>
            <el-menu-item :index="item.index" v-else>
                <i :class="item.icon"></i>
                <span slot="title">{{item.title}}</span>
            </el-menu-item>
        </template>
    </div>`,
  }
  var app = new Vue({
    el: '#app',
    components: {
      iseemenu
    },
    data: {
      iseeData: {
        version: iseeAdmin.version,
        drawer: false,
        direction: 'rtl',
        showClose: false,
        status: false,
        show: true,
        asideShow: iseeAdmin.asideShow,
        asideShowIcon: iseeAdmin.asideShowIcon,
        fullscreen: false,
        fullscreenIcon: '&#xe610;',
        defaultActive: iseeAdmin.defaultActive,
        tagList: iseeAdmin.tagList,
        breadcrumb: iseeAdmin.breadcrumb,
        menu: iseeMenu,
        avatar: iseeAvatar
      },
      /*your data*/
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now();
        },
        shortcuts: [{
          text: '今天',
          onClick(picker) {
            picker.$emit('pick', new Date());
          }
        }, {
          text: '昨天',
          onClick(picker) {
            const date = new Date();
            date.setTime(date.getTime() - 3600 * 1000 * 24);
            picker.$emit('pick', date);
          }
        }, {
          text: '一周前',
          onClick(picker) {
            const date = new Date();
            date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
            picker.$emit('pick', date);
          }
        }]
      },
      pickerOptions1: {
        shortcuts: [{
          text: '最近一周',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近一个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近三个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
            picker.$emit('pick', [start, end]);
          }
        }]
      },
      value: '',
      value1: '',
      value2: '',
      value3: '',
      value4: '',
      value5: '',
      value6: '',
      pickerOptions2: {
        shortcuts: [{
          text: '本月',
          onClick(picker) {
            picker.$emit('pick', [new Date(), new Date()]);
          }
        }, {
          text: '今年至今',
          onClick(picker) {
            const end = new Date();
            const start = new Date(new Date().getFullYear(), 0);
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '最近六个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setMonth(start.getMonth() - 6);
            picker.$emit('pick', [start, end]);
          }
        }]
      },
      value7: '',
      value8: '',
      value9: '',
      value10: '',
      value11: '',
      value12: '',

    },
    methods: {
      iseeTagSwitch(url, index, breadcrumb) {
        iseeAdmin.iseeTagSwitch(url, index, breadcrumb, this.iseeData)
      },

      iseeTagClose(url, index) {
        iseeAdmin.iseeTagClose(url, index, this.iseeData)
      },

      iseeTagCommandClose(command) {
        iseeAdmin.iseeTagCommandClose(command, this.iseeData)
      },

      iseeMenuOpen(key, keyPath) {
        iseeAdmin.iseeMenuOpen(key, keyPath, this.iseeData)
      },

      iseeFullScreen() {
        iseeAdmin.iseeFullScreen(this.iseeData)
      },

      iseeAsideShow() {
        iseeAdmin.iseeAsideShow(this.iseeData)
      },
      iseeOpenUrl(command) {
        iseeAdmin.iseeMenuOpen(this.iseeData.avatar.list[command].index, this.iseeData.avatar.list[command].indexPath, this.iseeData)
      },
      iseeTagDivMove(flag) {
        flag == 1 ? this.$refs.iseeTagDiv.scrollLeft += 80 : this.$refs.iseeTagDiv.scrollLeft -= 80
      },
      /*your methods*/

    },
    beforeMount() {
      iseeAdmin.init(this.iseeData)
      /*your beforeMount*/
    },
    mounted() {

    }
  });
</script>
</body>

</html>

